<%@ page language="java" pageEncoding="utf8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"
	dir="ltr">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" href="<c:url value="/css/shopadmin.css"/>"
			type="text/css" />
		<link rel="stylesheet"
			href="<c:url value='/scripts/themes/base/jquery.ui.all.css'/>"
			type="text/css" />


	</head>
	<body>
		<div id="headBar" class="head_content">
			 
			<div class="finder-action" id="">
				<div class="finder-action-inner clearfix">
					 
					<button submit=""
						wrapimg="true" target="_blank" type="button" class="btn">
						<span><span><i class="finder-icon"><img
										src="<c:url value="/images/transparent.gif"/>"
										class="imgbundle icon"
										style="width: 22px; height: 24px; background-position: 0pt -596px;" />
							</i>打印选定订单</span> </span>
					</button>
					<button type="button" onclick="location.reload()" class="btn">
						<span><span><i class="finder-icon"><img
										src="<c:url value="/images/transparent.gif"/>"
										class="imgbundle icon"
										style="width: 22px; height: 24px; background-position: 0pt -644px;"/>
							</i>刷新</span> </span>
					</button>
					<button type="button" class="btn">
						<span><span><i class="finder-icon"><img
										src="<c:url value="/images/transparent.gif"/>"
										class="imgbundle icon"
										style="width: 17px; height: 24px; background-position: 0pt -757px;"/>
							</i>删除</span> </span>
					</button>
					<button type="button" wrapimg="true" only_id="true"
						submit="index.php?ctl=order/order&amp;act=export"
						target="dialog::{height:200,width:280}" class="btn">
						<span><span><i class="finder-icon"><img
										src="<c:url value="/images/transparent.gif"/>"
										class="imgbundle icon"
										style="width: 25px; height: 24px; background-position: 0pt -484px;"/>
							</i>导出</span> </span>
					</button>
					<button type="button" onclick="openOrdersSearchDialog()"
						class="btn">
						<span><span><i class="finder-icon"><img
										src="<c:url value="/images/transparent.gif"/>"
										class="imgbundle icon"
										style="width: 26px; height: 24px; background-position: 0pt -460px;"/>
							</i>筛选</span> </span>
					</button>
				</div>
			</div>

			<div class="finder-header">
				<table cellpadding="0" cellspacing="0" width="100%">
					<!----cols---->
					<col style="width: 24px;" class="span-select" />
					<col style="width: 75px;" />
 					<col style="width: 110px;" />
					<col style="width: 90px;" />
					<col style="width: 130px;" />
					<col style="width: 75px;" />
					<col style="width: 75px;" />
					<col style="width: 75px;" />
					<col style="width: 110px;" />
					<col style="width: 150px;" />
					<col style="width: 75px;" />
					<col style="width: 75px;" />
					<col />

					<thead>
						<tr>
							<td>
								<input class="sellist" id="list_ids" type="checkbox" />
							</td>
							<td style="width: 48px;">
								&nbsp;查看
							</td> 
							<td>
								<div class="cell" key="order_id">
									<table cellpadding="0" cellspacing="0" width="100%">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">订单号</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							
							<td>
								<div class="cell " key="total_amount">
									<table cellpadding="0" cellspacing="0" width="100%">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">订单总额</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							<td>
								<div class="cell" key="createtime" order="DESC">
									<table cellpadding="0" cellspacing="0" width="100%">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">下单时间</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							<td>
								<div class="cell orderable" key="ship_name">
									<table cellpadding="0" cellspacing="0" width="100%">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">车辆ID</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							<td>
								<div class="cell orderable" key="pay_status">
									<table cellpadding="0" cellspacing="0" width="100%">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">订单状态</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							<td>
								<div class="cell orderable" key="ship_status">
									<table cellpadding="0" cellspacing="0" width="100%">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">开始时间</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							<td>
								<div class="cell orderable" key="shipping">
									<table cellpadding="0" cellspacing="0" width="100%">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">结束时间</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							 
							<td>
								<div class="cell orderable" key="member_id">
									<table cellpadding="0" cellspacing="0" width="100%">
										<tbody>
											<tr>
												<td>
													<span class="finder-col-label">会员ID</span>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</td>
							<td>
								&nbsp;
							</td>
						</tr>
					</thead>
				</table>

			</div>
		</div>
		<div id="main" class="main_content">
			<div class="finder-list finder-list-normal">
				<form id="list_form" action="sys_role_delete.html" method="post">


					<table cellpadding="0" cellspacing="0" width="100%" id="list_tbl">
						<!----cols---->
						<col style="width: 24px;" class="span-select" />
					<col style="width: 75px;" />
 					<col style="width: 110px;" />
					<col style="width: 90px;" />
					<col style="width: 130px;" />
					<col style="width: 75px;" />
					<col style="width: 75px;" />
					<col style="width: 75px;" />
					<col style="width: 110px;" /> 
					<col style="width: 75px;" />
						<col />
						<!----cols---->
						<tbody>
							<c:forEach var="order" items="${orders}" varStatus="index">
								<tr class=" row">
									<td>
										<input type="checkbox" value="${order.orderId }"
											name="orders[${index.index }].orderId" class="sel" />
									</td>
									<td class="finder-list-command">
										<a href="order_get.do?orderId =${order.orderId }"><img
												style="width: 16px; height: 16px; background-position: 0pt -1811px;"
												class="imgbundle"
												src="<c:url value="/images/transparent.gif"/>" />
												查看 
										</a>
									</td> 
									<td key="order_id">
										<div class="cell">
											${order.orderId}
										</div>
									</td>
									
									<td key="total_amount">
										<div class="cell">
											${order.totalAmount}
										</div>
									</td>
									<td key="createtime">
										<div class="cell">
											${order.createTimeString }
										</div>
									</td>
									<td key="ship_name">
										<div class="cell">
											${order.autoId}
										</div>
									</td>
									<td key="pay_status">
										<div class="cell">
											${order.status}
										</div>
									</td>
									<td key="ship_status">
										<div class="cell">
											${order.startDate}
										</div>
									</td>
									<td key="shipping">
										<div class="cell">
											${order.endDate}
										</div>
									</td>
									 
									<td key="member_id">
										<div class="cell">
											${order.memberId}
										</div>
									</td>
									<td>
										&nbsp;
									</td>
								</tr>
							</c:forEach>

						</tbody>
					</table>
				</form>

			</div>

		</div>
		<div id="footBar" class="foot_content">
			<div class="finder-footer" id="">
				<div class="finder-page clearfix">
					<div class="span-3">

					</div>
					<div class="span-auto">
						${pagerString }
					</div>
					<div class="span-auto textright">
						共
						<i>${fn:length(orders)}</i>条
					</div>
				</div>
			</div>

		</div>




		<div id="order_search_dialog" title="订单搜索" style="display: none;">
			<div id="search-tab">
				<form id="orders_search_form" name="gEditor" method="post"
					action="od_order_list.html">
					<input type="hidden" id="page_id" name="pagerId" />

					<div id="selector-panel-form">
						<div id=" ">
							<div class="gridlist">
								<div class="row">
									<div class="row-line">
										<div class="span-3">
											订单 ID
										</div>
										<div class="span-3">
											&nbsp;
										</div>
										<div class="span-6">
											<div class="object-select clearfix">
												<input class="x-input " name="orderParameter.orderId"
													type="text" id="orderParameter_orderId" />

											</div>
										</div>
										<div class="span-1">

										</div>
									</div>
								</div>
								<div class="row">
									<div class="row-line">
										<div class="span-3">
											会员用户名
										</div>
										<div class="span-3">
											&nbsp;
										</div>
										<div class="span-6">
											<input class="x-input" name="orderParameter.memberName"
												id="orderParameter_memberName" value="" type="text" />
										</div>
										<div class="span-1">

										</div>
									</div>
								</div>
								<div class="row">
									<div class="row-line">
										<div class="span-3">
											支付状态
										</div>
										<div class="span-3">
											&nbsp;
										</div>
										<div class="span-6">
											<select class="x-input-select  inputstyle"
												name="orderParameter.payStatus"
												id="orderParameter_payStatus">
												<option value="">
													请选择
												</option>
												<option value="0">
													未支付
												</option>
												<option value="1">
													已支付
												</option>
												<option value="2">
													处理中
												</option>
												<option value="3">
													部分付款
												</option>
												<option value="4">
													部分退款
												</option>
												<option value="5">
													全额退款
												</option>
											</select>
										</div>
										<div class="span-1">

										</div>
									</div>
								</div>
								<div class="row">
									<div class="row-line">
										<div class="span-3">
											发货状态
										</div>
										<div class="span-3">
											&nbsp;
										</div>
										<div class="span-6">
											<select class="x-input-select  inputstyle"
												name="orderParameter.shipStatus"
												id="orderParameter_shipStatus">
												<option value="">
													请选择
												</option>
												<option value="0">
													未发货
												</option>
												<option value="1">
													已发货
												</option>
												<option value="2">
													部分发货
												</option>
												<option value="3">
													部分退货
												</option>
												<option value="4">
													已退货
												</option>

											</select>
										</div>
										<div class="span-1">

										</div>
									</div>
								</div>
								<div class="row">
									<div class="row-line">
										<div class="span-3">
											支付方式
										</div>
										<div class="span-3">
											&nbsp;
										</div>
										<div class="span-6">
											<select class="x-input-select  inputstyle"
												name="orderParameter.paymentTypeId"
												id="orderParameter_paymentTypeId">
												<option value="">
													无
												</option>
												<c:forEach var="cfg" items="${orderPaymentCfgs}" varStatus="index">
												<option value="${cfg.pcId }">${cfg.customName}
												</option>
												</c:forEach>

											</select>
										</div>
										<div class="span-1">

										</div>
									</div>
								</div>
								<div class="row">
									<div class="row-line">
										<div class="span-3">
											配送方式
										</div>
										<div class="span-3">
											&nbsp;
										</div>
										<div class="span-6">
											<select class="x-input-select  inputstyle"
												name="orderParameter.shippingId"
												id="orderParameter_shippingId">
												<option value="">
													无
												</option>
												<c:forEach var="dt" items="${orderDeliveryTypes}" varStatus="index">
												<option value="${dt.dtId }">${dt.dtName}
												</option>
												</c:forEach>

											</select>
										</div>
										<div class="span-1">

										</div>
									</div>
								</div>
								<div class="row">
									<div class="row-line">
										<div class="span-3">
											收货人
										</div>
										<div class="span-3">

											&nbsp;
										</div>
										<div class="span-6">
											<input class="x-input " name="orderParameter.shipName"
												type="text" id="orderParameter_shipName" />
										</div>
										<div class="span-1">

										</div>
									</div>
								</div>
								<div name="regtime" class="row">
									<div class="row-line">
										<div tp="label" class="span-3">
											下单时间
										</div>
										<div tp="allege" class="span-3">
											&nbsp;
										</div>
										<div tp="input" class="span-7">

											<input type="text" size="10" id="orderParameter_begin"
												value="${orderParameter.begin}" name="orderParameter.begin"
												class="cal " />
											-
											<input type="text" size="10" id="orderParameter_end"
												value="${orderParameter.end }" name="orderParameter.end"
												class="cal " />
										</div>
										<div class="span-1"></div>
									</div>
								</div>
								<div class="row">
									<div class="row-line">
										<div class="span-3">
											订单总额
										</div>
										<div class="span-3">
											<select class="x-input-select  inputstyle"
												name="orderParameter.totalAmountOperator"
												id="orderParameter_totalAmountOperator">
												<option value="than">
													大于
												</option>
												<option value="lthan">
													小于
												</option>
												<option value="equal">
													等于
												</option>
												<option value="sthan">
													小于等于
												</option>
												<option value="bthan">
													大于等于
												</option>
											</select>
											&nbsp;
										</div>
										<div class="span-6">
											<input class="x-input " name="orderParameter.totalAmount"
												type="text" id="orderParameter_totalAmount" />
										</div>
										<div class="span-1">

										</div>
									</div>
								</div>

							</div>
						</div>
					</div>
					<div class="scrollhandle toLeft gridlist-head"
						style="text-align: center;">
						<button type="button" class="btn" onclick="searchSubmit(1)">
							<span><span>&nbsp;&nbsp;搜索&nbsp;&nbsp;</span> </span>
						</button>
					</div>
				</form>
			</div>

		</div>



		<script type="text/javascript"
			src="<c:url value='/scripts/jquery-1.4.2.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/jquery.bgiframe-2.1.1.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/ui/jquery.ui.core.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/ui/jquery.ui.widget.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/ui/jquery.ui.datepicker.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/ui/i18n/jquery.ui.datepicker-zh-CN.js'/>"></script>

		<script type="text/javascript"
			src="<c:url value='/scripts/ui/jquery.ui.mouse.js'/> "></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/ui/jquery.ui.button.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/ui/jquery.ui.draggable.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/ui/jquery.ui.position.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/ui/jquery.ui.dialog.js'/>"></script>
		<script type="text/javascript"
			src="<c:url value='/scripts/ui/jquery.effects.core.js'/> "></script>
		<%@ include file="/jsp/admin/common/messages.jsp"%>
		<script type="text/javascript">
		
 
 
	 


	function searchSubmit(pageId){
		$('#page_id').attr('value',pageId);
		$('#orders_search_form').submit();
	}

	


	 
	
	
		$(function() {	
			
        	$("#order_search_dialog").dialog({
				autoOpen: false,
				height: 350,
				width: 550,
				modal: true,
				close: function() {
					 
				}
			});
        });
        function openOrdersSearchDialog(){		 	
			$('#order_search_dialog').dialog('open');
		}
		
		<c:if test="${not empty orderParameter}" >		   
		   $('#orderParameter_orderId').attr('value', '${orderParameter.orderId}');
			$('#orderParameter_memberName').attr('value','${orderParameter.memberName}');
			$('#orderParameter_payStatus').attr('value','${orderParameter.payStatus}');
			$('#orderParameter_shipStatus').val( '${orderParameter.shipStatus}' );
			$('#orderParameter_paymentTypeId').val( '${orderParameter.paymentTypeId}');
			$('#orderParameter_shippingId').attr('value', '${orderParameter.shippingId}');
			$('#orderParameter_shipName').val( '${orderParameter.shipName}' );
			$('#orderParameter_begin').attr('value', '${orderParameter.begin}');	
			$('#orderParameter_end').attr('value', '${orderParameter.end}');	
			$('#orderParameter_totalAmountOperator').attr('value', '${orderParameter.totalAmountOperator}');	
			$('#orderParameter_totalAmount').attr('value', '${orderParameter.totalAmount}');				
		</c:if>
		
	$("#orderParameter_begin").datepicker( $.datepicker.regional['zh-CN']);
	$("#orderParameter_end").datepicker( $.datepicker.regional['zh-CN']);
 
	var selected = 'selected';
	$("#list_ids").click(function() {

		if (this.checked) {
			$('input[type=checkbox]').attr("checked", true);

			$('#list_tbl >tbody> tr').addClass(selected);
		} else {
			$('input[type=checkbox]').attr("checked", false);
			$('#list_tbl > tbody > tr').removeClass(selected);
		}
	});
	
	$('#view_id_'+'${orderParameter.viewId}').addClass('cur');

	function changeColor(obj) {
		if ($(obj).attr("checked")) {
			$(obj).parent().parent().addClass(selected);
		} else {
			$(obj).parent().parent().removeClass(selected);
		}
	}

	function batchDelete() {
		var selected = false;
		$('#list_tbl input[type=checkbox]').each(function(i, dom) {
			if ($(dom).attr("checked")) {
				selected = true;
			}
		});
		if (!selected) {
			alert('请选择要删除的数据');
			return;
		}
		if (!confirm("确定删除吗？")) {
			return;
		}
		$('#list_form').submit();
	}
	//templateId
	function orderPrint(orderId,templateId){
		location.href= 'od_order_print.html?orderId='+orderId+'&templateId='+templateId  ;
	}
	
</script>


	</body>


</html>

